package com.fast.common.pojo.req;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PageReq {

    private int startRow = 1;

    private int endRow = 100;


    public final int pageSize() {
        return endRow - startRow + 1;
    }

    public final int pageNum() {
        return (endRow + pageSize() -1) / pageSize();
    }

    public final long lastRow(long count){

        return getStartRow()+pageSize()-1>= count?-1:getStartRow()+pageSize()-1;
    }

}
